#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int a[10] = { 0 };
	char c = 0;
	scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-%c", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6], &a[7], &a[8], &c);
	int x = (a[0] * 1 + a[1] * 2 + a[2] * 3 + a[3] * 4 + a[4] * 5 + a[5] * 6 + a[6] * 7 + a[7] * 8 + a[8] * 9) % 11;
	int ret = 0;
	if (c == 'X')
		ret = 10;
	else
		ret = c - '0';

	if (x == ret)
		printf("Right\n");
	else
	{
		printf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);
		if (x == 10)
			printf("X");
		else
			printf("%d", x);
	}

	return 0;
}